/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import model.dao.AlunoJpaController;
import model.dao.DaoBase;
import model.dao.DisciplinaJpaController;
import model.dao.ProfessorJpaController;
import model.dao.TurmaJpaController;
import model.pojo.Aluno;
import model.pojo.Disciplina;
import model.pojo.Professor;
import model.pojo.Turma;

/**
 *
 * @author leonidia
 */
public class CadastrarTurma extends javax.swing.JFrame {

    Integer opcaoDisciplina;
    Integer opcaoProfessor;
    ArrayList<String> listaDisciplina;
    ArrayList<String> listaProfessor;
    TurmaJpaController turmaJpaController = null;
    List<Disciplina> listaD;
    List<Professor> listaP;
    List<Aluno> listaA;
    List<Aluno> alunos = new LinkedList<>();
    DefaultTableModel tabelaGeral;
    Integer tamanhoTabela = 0;
    DaoBase daoBase = null;

    /**
     * Creates new form CadastrarTurma
     * @param daoBase Cadastra os dados da turma e a envia para o turmaJpaController inserir ela no BD.
     */
    public CadastrarTurma(DaoBase daoBase) {
        initComponents();
        this.daoBase = daoBase;
        tabelaGeral = (DefaultTableModel) TabelaAlunoExistente.getModel();
        turmaJpaController = new TurmaJpaController(null, daoBase.returnFactory());
        AtualizaDisciplina();
        AtualizaProfessor();
        atualizarAluno();
        /*Gera os valores das listas
         listaProfessor = new ArrayList<>();

         DefaultComboBoxModel defaultProfessor = new DefaultComboBoxModel(listaProfessor.toArray());
         ListaProfessor.setModel(defaultProfessor);
         */
        opcaoDisciplina = -2;
        opcaoProfessor = -2;
    }

    public void atualizarAluno() {
        AlunoJpaController alunoJpaController = new AlunoJpaController(null, daoBase.returnFactory());
        listaA = alunoJpaController.findAlunoEntities();
        for (Aluno item : listaA) {
            tabelaGeral.addRow(new Object[]{false, item.getNome(), item.getCpf(), item.getMatricula()});
        }
    }

    public void GerarNovaTabelaAluno() {
        DefaultTableModel model = (DefaultTableModel) TabelaAlunoAdicionado.getModel();
        AlunoJpaController alunoJpaController = new AlunoJpaController(null, daoBase.returnFactory());

        int i;
        if (tamanhoTabela == 0) {
            tamanhoTabela = Integer.parseInt(JOptionPane.showInputDialog("Quantidade de Vagas nao informada", null));
            Vagas.setText(Integer.toString(tamanhoTabela));
        }
        for (i = 0; i < tabelaGeral.getRowCount(); i++) {
            if (tabelaGeral.getValueAt(i, 0) == true) {
                model.addRow(new Object[]{listaA.get(i).getNome(), listaA.get(i).getCpf(), listaA.get(i).getMatricula()});
                alunos.add(listaA.get(i));
            }
        }
    }

    public void AtualizaDisciplina() {
        DisciplinaJpaController disciplinaJpaController = new DisciplinaJpaController(null, daoBase.returnFactory());
        listaDisciplina = new ArrayList<String>();
        listaD = disciplinaJpaController.findDisciplinaEntities();

        for (Disciplina item : listaD) {
            listaDisciplina.add(item.getNome());
        }
        DefaultComboBoxModel defaultDisciplina = new DefaultComboBoxModel(listaDisciplina.toArray());
        ListaDisciplina.setModel(defaultDisciplina);
    }

    public void AtualizaProfessor() {
        ProfessorJpaController professorJpaController = new ProfessorJpaController(null, daoBase.returnFactory());
        listaProfessor = new ArrayList<String>();
        listaP = professorJpaController.findProfessorEntities();

        for (Professor item : listaP) {
            listaProfessor.add(item.getNome());
        }
        DefaultComboBoxModel defaultProfessor = new DefaultComboBoxModel(listaProfessor.toArray());
        ListaProfessor.setModel(defaultProfessor);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        Salvar = new javax.swing.JButton();
        Limpar = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        TabelaAlunoExistente = new javax.swing.JTable();
        Ano = new javax.swing.JFormattedTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        Vagas = new javax.swing.JTextField();
        Local = new javax.swing.JTextField();
        Horario = new javax.swing.JFormattedTextField();
        ListaDisciplina = new javax.swing.JComboBox();
        Periodo = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        Disciplina = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        Professor = new javax.swing.JRadioButton();
        ListaProfessor = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        TabelaAlunoAdicionado = new javax.swing.JTable();
        EnviarAluno = new javax.swing.JButton();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        Salvar.setText("Salvar");
        Salvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SalvarActionPerformed(evt);
            }
        });

        Limpar.setText("Limpar");
        Limpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LimparActionPerformed(evt);
            }
        });

        TabelaAlunoExistente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "", "Nome", "Cpf", "Matricula"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        TabelaAlunoExistente.setColumnSelectionAllowed(true);
        TabelaAlunoExistente.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(TabelaAlunoExistente);
        TabelaAlunoExistente.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        TabelaAlunoExistente.getColumnModel().getColumn(0).setResizable(false);
        TabelaAlunoExistente.getColumnModel().getColumn(0).setPreferredWidth(5);

        try {
            Ano.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        Ano.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AnoActionPerformed(evt);
            }
        });

        jLabel8.setText("Vagas");

        jLabel6.setText("Horário");

        jLabel7.setText("Local");

        jLabel4.setText("Ano");

        jLabel5.setText("Período ");

        Vagas.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                VagasFocusLost(evt);
            }
        });

        try {
            Horario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##:##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        ListaDisciplina.setToolTipText("");
        ListaDisciplina.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ListaDisciplinaActionPerformed(evt);
            }
        });

        jLabel3.setText("Professores");

        buttonGroup1.add(Disciplina);
        Disciplina.setText("Disicplina não Cadastrada");
        Disciplina.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DisciplinaActionPerformed(evt);
            }
        });

        jLabel2.setText("Cadastrar Turma");

        jLabel1.setText("Disciplinas");

        Professor.setText("Professor não cadastrado");
        Professor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ProfessorActionPerformed(evt);
            }
        });

        ListaProfessor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ListaProfessorActionPerformed(evt);
            }
        });

        jLabel10.setText("Alunos da turma");

        jLabel11.setText("Todos Alunos");

        TabelaAlunoAdicionado.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "nome", "Cpf", "Matricula"
            }
        ));
        jScrollPane2.setViewportView(TabelaAlunoAdicionado);

        EnviarAluno.setText("     Adicionar Selecionados >>");
        EnviarAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EnviarAlunoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(728, Short.MAX_VALUE)
                .addComponent(jLabel10)
                .addGap(181, 181, 181))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(EnviarAluno)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(801, 801, 801)
                        .addComponent(Limpar)
                        .addGap(18, 18, 18)
                        .addComponent(Salvar))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(ListaProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Professor))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(ListaDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Disciplina)))
                        .addGap(115, 115, 115)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Local, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Ano, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Periodo, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(16, 16, 16)
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Horario, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(12, 12, 12)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(Vagas, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(242, 242, 242)
                        .addComponent(jLabel2)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addComponent(jLabel2)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(ListaDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(Disciplina))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel4)
                                .addComponent(jLabel5)
                                .addComponent(Periodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(Ano, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel6)
                                .addComponent(Horario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel8)
                                .addComponent(Vagas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(Professor)
                            .addComponent(ListaProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)
                            .addComponent(Local, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                        .addComponent(jLabel11)
                        .addGap(44, 44, 44)
                        .addComponent(EnviarAluno)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Salvar)
                    .addComponent(Limpar))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void DisciplinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DisciplinaActionPerformed
        opcaoDisciplina = -1;
        CadastrarDisciplina cadastrarDisciplina = new CadastrarDisciplina(daoBase);
        cadastrarDisciplina.run();
        dispose();
    }//GEN-LAST:event_DisciplinaActionPerformed

    private void SalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SalvarActionPerformed
        // TODO add your handling code here:
        Integer ano = Integer.parseInt(Ano.getText());
        Integer periodo = null;
        try {  
            periodo = Integer.parseInt(Periodo.getText());  
        } catch (Exception z) {   
            JOptionPane.showMessageDialog(this, "O período deve conter apenas um número", "Erro!", JOptionPane.ERROR_MESSAGE);  
            Periodo.setText("");  
            return;  
        } 
        
        String local = Local.getText();
        String horario = Horario.getText();;
        Integer numeroDeVagas = Integer.parseInt(Vagas.getText());
        if((ano!=null) && (null!=periodo) &&(null!= local) && (null!=horario) &&(null!= numeroDeVagas)) {
            Turma turma = new Turma(ano, periodo, local, horario, numeroDeVagas);
            if (opcaoProfessor != -1) {
                opcaoProfessor = ListaProfessor.getSelectedIndex();
                turma.setProfessor(listaP.get(opcaoProfessor));
            }
            if (opcaoDisciplina != -1) {
                opcaoDisciplina = ListaDisciplina.getSelectedIndex();
                turma.setDisciplina(listaD.get(opcaoDisciplina));
            }
            turma.setAluno(alunos);
            turmaJpaController.create(turma);
            dispose();
        }
    }//GEN-LAST:event_SalvarActionPerformed

    private void LimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LimparActionPerformed
        // TODO add your handling code here:
        Horario.setText(null);
        Ano.setText(null);
        Periodo.setText(null);
        Vagas.setText(null);
        Local.setText(null);
    }//GEN-LAST:event_LimparActionPerformed

    private void ListaDisciplinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ListaDisciplinaActionPerformed
        // TODO add your handling code here:
        opcaoDisciplina = ListaDisciplina.getSelectedIndex();
    }//GEN-LAST:event_ListaDisciplinaActionPerformed
    public void AddLista(String string) {
        listaDisciplina.add(string);
    }
    private void ListaProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ListaProfessorActionPerformed
        // TODO add your handling code here:
        opcaoProfessor = ListaProfessor.getSelectedIndex();
    }//GEN-LAST:event_ListaProfessorActionPerformed

    private void ProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProfessorActionPerformed
        CadastrarProfessor cadastrarProfessor = new CadastrarProfessor(daoBase);
        cadastrarProfessor.run();
        opcaoProfessor = -1;
        dispose();
    }//GEN-LAST:event_ProfessorActionPerformed

    private void AnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AnoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_AnoActionPerformed

    private void EnviarAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EnviarAlunoActionPerformed
        // TODO add your handling code here:
        GerarNovaTabelaAluno();
    }//GEN-LAST:event_EnviarAlunoActionPerformed

    private void VagasFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_VagasFocusLost
        tamanhoTabela = Integer.parseInt(Vagas.getText());
    }//GEN-LAST:event_VagasFocusLost

    /**
     * @param args the command line arguments
     */
    public void run() {
        setVisible(true);
    }

    public void stop() {
        setVisible(false);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFormattedTextField Ano;
    private javax.swing.JRadioButton Disciplina;
    private javax.swing.JButton EnviarAluno;
    private javax.swing.JFormattedTextField Horario;
    private javax.swing.JButton Limpar;
    private javax.swing.JComboBox ListaDisciplina;
    private javax.swing.JComboBox ListaProfessor;
    private javax.swing.JTextField Local;
    private javax.swing.JTextField Periodo;
    private javax.swing.JRadioButton Professor;
    private javax.swing.JButton Salvar;
    private javax.swing.JTable TabelaAlunoAdicionado;
    private javax.swing.JTable TabelaAlunoExistente;
    private javax.swing.JTextField Vagas;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
